<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>product</title>
    <link rel="StyleSheet" href="/css/jpetstore.css" type="text/css" media="screen"/>
</head>
<body>
<div th:replace="common/top">
</div>

<div id="Content">
    <div id="BackLink">
        <a th:href="@{'/catalog/viewCategory?categoryId='+${product.categoryId}}">
            <td th:text="'Return to '+${product.categoryId}">Return</td>
        </a>
    </div>

    <div id="Catalog">

        <h2 th:text="${product.name}">product.name</h2>

        <table>
            <tr>
                <th>Item ID</th>
                <th>Product ID</th>
                <th>Description</th>
                <th>List Price</th>
                <th>&nbsp;</th>
            </tr>

            <tr th:each="item:${itemList}">
                <td>
                    <a th:text="${item.itemId}" th:href="@{'/catalog/viewItem?itemId='+${item.itemId}}">itemId</a>
                </td>
                <td th:text="${item.product.productId}">
                    productId
                </td>
                <td th:text="${item.attribute1}+${product.name}">
                    <!--                        ${item.attribute1} ${item.attribute2} ${item.attribute3}-->
                    <!--                        ${item.attribute4} ${item.attribute5} ${sessionScope.product.name}-->
                </td>
                <td th:text= "${item.listPrice}" pattern="$#,##0.00">
                    value
                </td>
                <td th:if="${(session.username)!=NullPointerException}">
                    <a class="Button" th:href="@{/cart/addItemToCart(workingItemId=${item.itemId},username=${session.username})}">Add to Cart</a>
                </td>
            </tr>
            <tr>
                <td>
                </td>
            </tr>
        </table>

    </div>
</div>

<div th:replace="common/bottom">
</div>
</body>
</html>